A moving average is a statistical technique for determining a mean of a subset of a series of data points. Given a series of data items, the moving average is initially determined by calculating the mean of items in an initial subset of the data, for example, the first 10 items in the series. The next moving average is calculated by removing from the subset the first item in the series, adding to the subset the next item in the series, and then again calculating the mean. The moving average thus forms a “window” that moves successively along the time series. At each position, the window defines the number of recent items to use for calculation of the mean.
The moving average is commonly used to smooth short-term variability in a time series of data. However, the moving average is subject to a number of shortcomings. For example, the effectiveness of a moving average for a given application is highly dependent on the window size. If the window size is too large, then high frequency signals will be largely or completely eliminated. Similarly, the average will be slow to respond to sudden changes. On the other hand, if the window size is too small, the average will be over-responsive to changing conditions, possibly leading to over-dynamic system behavior.